package com.interview.item.javabase.setdemo;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.*;

/**
 * @Author:zxh
 * @Description:
 * @Date: 2020/3/24
 * @Modified By:
 */
public class MapDemo {
    private static Logger log = LoggerFactory.getLogger(MapDemo.class);

    /**
     * @Author:zxh
     * @Description: hasMap\hasTable 区别：
     * @Date: 2020/3/24
     */
    static void hasMapTable() {
        HashMap<String, String> objectObjectHashMap = new HashMap<>();
        objectObjectHashMap.put("", "4");
        Hashtable<String, String> objectObjectHashtable = new Hashtable<>();
        objectObjectHashtable.put("", "4");
        for (String table : objectObjectHashMap.values()
                ) {
            log.info("hasmap:{}", table);
        }
        for (String table : objectObjectHashtable.values()
                ) {
            log.info("table:{}", table);
        }
    }

    /**
      * @Author:zxh
      * @Description:
      * @Date: 2020/3/24
      */
    static void listSet(){
        HashSet<Integer> integers = new HashSet<>();
        integers.add(2);
        integers.add(2);
        for (Integer inte:integers
             ) {
            log.info("输出：{}",inte);

        }

    }


    public static void main(String[] args) {
        hasMapTable();
        listSet();
    }
}
